<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:common="http://www.contact.common.com/contacts/ui"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:mail="http://www.contact.mail.com/contacts/mail/ui">

<ui:component>
        <!--@elvariable id="id" type="java.lang.String"-->
    <!--@elvariable id="reRender" type="java.lang.String"-->
    <common:modalPanel id="#{id}"
                       header="#{resources.sendMessageLabel}"
                       submitButton="Send"
                       reRender="#{reRender}"
            >

        <ui:define name="panelBody">
            <mail:composeMessage showReceivers="false" showTopic="true"/>
             <!--            Dirty HACK! :P          -->
            <h:inputHidden id="messageReceiver" value="#{createMessageBean.receivers}"/>
        </ui:define>
        <ui:define name="actionCommand">
            <h:panelGroup layout="block" style="text-align:right">
                    <a4j:commandButton value="#{resources.sendLabel}" action="#{createMessageBean.send}" oncomplete="Richfaces.hideModalPanel('#{id}');">
                    </a4j:commandButton>

                    <a4j:commandButton value="#{resources.cancelButton}" type="reset" oncomplete="Richfaces.hideModalPanel('#{id}');"/>
            </h:panelGroup>
        </ui:define>
    </common:modalPanel>


</ui:component>


</html>